#ifndef __DOUBLE_LIST_H__
#define __DOUBLE_LIST_H__

#include "element.h"

typedef struct Double_Node
{
    Stu_t data;
    struct Double_Node *prev;
    struct Double_Node *next;
}Double_Node;


typedef struct Double_link_List
{
    Double_Node * head;
}Double_link_List;

//双向链表的创建
Double_link_List *Init_Double_Link_List(void);
//双向链表的插入
void insert_double_node(Double_link_List * list,Stu_t data,int index);
//双向链表的遍历
void print_forward_double_link_list(Double_link_List * list);
void print_backwards_double_link_list(Double_link_List * list);
//双向链表的删除
void delet_double_node(Double_link_List * list,int index);
//双向链表的查找
Double_Node* Find_Node(Double_link_List *list, int id);
//双向链表的修改
void data_double_node(Double_link_List *list,int id);
//双向链表的合并
Double_link_List* merge_double_link_lists(Double_link_List* list1, Double_link_List* list2);
//双向链表的销毁
void free_double_link_list(Double_link_List* list);



//循环列表的创建
Double_link_List *cir_Double_link_list(void);
//循环链表的插入
void cir_insert_double_node(Double_link_List * list, Stu_t data, int index);
//循环列表向前遍历
void cir_print_backwards_double_link_list(Double_link_List * list);
//双向循环列表的合表
Double_link_List* cir_merge_double_link_lists(Double_link_List* list1, Double_link_List* list2);
//双向循环链表的删除
void delete_double_node(Double_link_List* list, int index);

#endif